package com.taxshare.manager.controller;

import com.taxshare.manager.service.RoleService;
import com.taxshare.manager.view.dto.CompanyDTO;
import com.taxshare.manager.view.dto.RoleDTO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: CompanyController
 * @Description:
 * @author: luozhongyi
 * @date: 2021/1/25 9:41
 */
@RestController
@RequestMapping(value = "/role")
@Api(tags = "角色信息")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @RequestMapping(method = RequestMethod.POST, value = "/add")
    @ApiOperation(notes = "角色信息", value = "新增")
    public Response add(@RequestBody RoleDTO roleDTO) {
        return roleService.add(roleDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/edit")
    @ApiOperation(notes = "角色信息", value = "编辑")
    public Response edit(@RequestBody RoleDTO roleDTO) {
        return roleService.edit(roleDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/delete")
    @ApiOperation(notes = "角色信息", value = "删除")
    public Response delete(@RequestBody RoleDTO roleDTO) {
        return roleService.delete(roleDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/info")
    @ApiOperation(notes = "角色信息", value = "查询")
    public Response info(@RequestBody RoleDTO roleDTO) {
        return roleService.info(roleDTO);
    }
}
